function ajax_crud(url, param, msg) {
    if (msg == undefined) {
        msg = "操作成功";
    }
    $.ajax({
        type: "post",
        url: url,
        cache: false,  //禁用缓存
        // 列如
        // data:{username:"username",password:"password"},
        data: param,  //传入组装的参数
        dataType: "json",
        success: function () {
            layer.msg(msg, {
                icon: 1,
                //2秒关闭（如果不配置，默认是3秒）
                time: 1000
            }, function () {
                layer.close(index);
            });
        },
        error: function () {
            layer.msg('操作失败');
        }
    });
}

function ajax_query(url, param) {
    var result = $.ajax({
        type: "post",
        url: url,
        cache: false,  //禁用缓存
        // 列如
        // data:{username:"username",password:"password"},
        data: param,  //传入组装的参数
        async:false,
        dataType: "JSON",
        success: function (data) {
            return data;
        },
        error: function () {
            layer.msg('查询失败');
        }
    });
    return result;

}